package com.iotmonitor.iot.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import com.iotmonitor.common.core.annotation.Excel;
import com.iotmonitor.common.core.web.domain.BaseEntity;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 指标配置对象 tb_quota
 * 
 * @author ruoyi
 * @date 2023-08-11
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TbQuota extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @NotBlank(message = "报警名不能为空", groups = {TbQuota.Update.class})
    private Long id;

    /** 指标名称 */
    @Excel(name = "指标名称")
    @NotBlank(message = "指标名称不能为空", groups = {TbQuota.Create.class})
    private String name;

    /** 指标单位 */
    @Excel(name = "指标单位")
    @NotBlank(message = "指标单位不能为空", groups = {TbQuota.Create.class})
    private String unit;

    /** 报文主题 */
    @Excel(name = "报文主题")
    @NotBlank(message = "报文主题长度不能为空", groups = {TbQuota.Create.class})
    @Size(min = 0, max = 100, message = "报文主题长度不能超过100个字符", groups = {TbQuota.Create.class})
    private String subject;

    /** 指标字段类型，Double、Inteter、Boolean */
    @Excel(name = "指标字段类型，Double、Inteter、Boolean")
    private String valueType;

    /** 指标值字段 */
    @Excel(name = "指标值字段")
    @NotBlank(message = "指标值不能为空", groups = {TbQuota.Create.class})
    private String valueKey;

    /** 设备识别码字段 */
    @Excel(name = "设备识别码字段")
    private String snKey;

    /** web钩子 */
    @Excel(name = "web钩子")
    private String webhook;

    /** 参考值 */
    @Excel(name = "参考值")
    private String referenceValue;

    public TbQuota(String subject) {
        this.subject = subject;
    }
}
